package com.ymttest.database.sqlwapper.shenqisettlement;

import java.util.List;

import com.ymt.database.SqlManager;
import com.ymttest.database.model.shenqisettlement.BankRequiredField;

public class BankRequiredFieldWrapper {

	SqlManager manager;

	public BankRequiredFieldWrapper() {
		manager = new SqlManager("shenqisettlement");
	}

	@SuppressWarnings("unchecked")
	public BankRequiredField selectByPrimaryKey(long id) {

		BankRequiredField bankRequiredField = new BankRequiredField();
		List<BankRequiredField> result = manager
				.getSelectResults(
						"com.ymttest.database.mapping.shenqisettlement.BankRequiredFieldMapper.selectByPrimaryKey",
						id);
		manager.commit();

		if (result.size() > 0) {
			bankRequiredField = result.get(0);
		}

		return bankRequiredField;
	}
	
	@SuppressWarnings("unchecked")
	public List<BankRequiredField> selectByCountryCode(String countryCode) {

		List<BankRequiredField> result = manager
				.getSelectResults(
						"com.ymttest.database.mapping.shenqisettlement.BankRequiredFieldMapper.selectByCountryCode",
						countryCode);
		manager.commit();

		return result;
	}
	
	@SuppressWarnings("unchecked")
	public List<BankRequiredField> selectByNothing() {

		List<BankRequiredField> result = manager
				.getSelectResults(
						"com.ymttest.database.mapping.shenqisettlement.BankRequiredFieldMapper.selectByNothing",
						null);
		manager.commit();

		return result;
	}
	
	public static void main(String[] args) {
		
		BankRequiredFieldWrapper wrapper = new BankRequiredFieldWrapper();
		
		System.out.println(wrapper.selectByNothing().get(0).getCountry_code());
	}
}
